﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Telerik.Web.UI;
public partial class Admin_Membership : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            if (Membership.GetUser().UserName.ToString() != null)
            {
                string UserID = Membership.GetUser().ProviderUserKey.ToString();
                var FirstName = new DealesDataContext();
                if (Roles.IsUserInRole(Membership.GetUser().UserName.ToString(), "Admin"))
                {

                }
                else
                {
                    Response.Redirect("~/Admin/Login.aspx");
                }
            }
            else
            {
                Response.Redirect("~/Admin/Login.aspx");
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("~/Admin/Login.aspx");
        }
    }
    protected void LoginStatus1_LoggedOut(object sender, EventArgs e)
    {
        Response.Redirect("~/Admin/Login.aspx");
    }

}
